﻿using Newtonsoft.Json;
using SimpleJSON;
using System.Collections.Generic;

namespace MBP.ModBase
{
    public class ModInfo
    {
        public string id { get; set; }
        public string name { get; set; }
        public List<string> author_list { get; set; }
        public string description { get; set; }
        public List<string> dependencies { get; set; }
        public string version { get; set; }
        public string lbol_version { get; set; }
        public string mbp_version { get; set; }
        [JsonIgnore]
        public string mod_path { get; set; }

        public override string ToString()
        {
            return $"[Mod:{name}||{description}]";
        }

        public ModInfo(JSONNode jsonNode)
        {
            id = jsonNode["id"];
            name = jsonNode["name"];
            author_list = jsonNode["author_list"].AsStringList;
            description = jsonNode["description"];
            dependencies = jsonNode["dependencies"].AsStringList;
            version = jsonNode["version"];
            lbol_version = jsonNode["lbol_version"];
            mbp_version = jsonNode["mbp_version"];
        }
    }
}
